﻿using Dsl.Ped.AddIn.Beeps.Generated;
using Dsl.Ped.AddIn.Java.Resources;

namespace Dsl.Ped.AddIn.Beeps.Helpers
{
    /// <summary>
    /// Helper methods of the <see cref="BeepsBeep"/>
    /// </summary>
    public static class BeepsBeepHelper
    {
        /// <summary>
        /// Converts the <see cref="BeepsBeep"/> object to the plain text
        /// </summary>
        /// <param name="beepsBeep"><see cref="BeepsBeep"/> object to be converted</param>
        /// <param name="tabsCount">Number of tabs indention</param>
        /// <returns><see cref="BeepsBeep"/> object converted to the plain text</returns>
        public static string ToPlainText(this BeepsBeep beepsBeep, int tabsCount)
        {
            string tabs = new string('\t', tabsCount);
            return string.Format("{0}{1}Beep{1}({2});\r\n", tabs, BeepsResources.KeyWordsDelimiter, beepsBeep.frequence);
        }
    }
}
